Skip to content

fix(interpreter): expand assoc array keys with command subs, fix set -e in compound commands#874

Closed
chaliy wants to merge 1 commit intomainfrom
claude/fix-bashkit-issues-ZpMe1
Closed

fix(interpreter): expand assoc array keys with command subs, fix set -e in compound commands#874
chaliy wants to merge 1 commit intomainfrom
claude/fix-bashkit-issues-ZpMe1

Conversation

@chaliy
Copy link
Copy Markdown
Contributor

@chaliy chaliy commented Mar 27, 2026

Summary

Test plan

  • New test assoc_key_command_substitution — verifies m["$(echo hello)"]="world" expands key to hello
  • New test assoc_key_variable_expansion — verifies m[$key] still works
  • New test assoc_key_literal_unchanged — verifies bare literal keys unchanged
  • New test set_e_for_loop_and_chain_no_exit — reproduces exact issue set -e incorrectly triggers on compound commands whose body ends with && chain failure #873 scenario
  • New test set_e_while_loop_and_chain_no_exit — while loop variant
  • New test set_e_plain_failure_in_loop_still_exits — ensures set -e still works for non-AND-OR failures
  • All existing set_e_and_or_tests pass (9/9)
  • Full test suite passes

…-e in compound commands

Fix #872: Add async expand_assoc_key() that uses full word expansion
(parse_word_string + expand_word) for associative array keys containing
$() or backtick substitutions, replacing the sync-only
expand_variable_or_literal() in process_command_assignments().

Fix #873: Check result.errexit_suppressed in execute_script_body() so
compound commands (for/while/until) whose body ends with an AND-OR
chain failure do not incorrectly trigger set -e.
@chaliy chaliy closed this Mar 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant